/**
 * https://leetcode.cn/problems/running-sum-of-1d-array/submissions/589879842/
 * 1480. 一维数组的动态和
 * easy 2024.12.28
 * 前缀和后缀和差分
 */

class Solution {
public:
    vector<int> runningSum(vector<int>& nums) {
        for(int i=1;i<nums.size();++i)
            nums[i]=nums[i]+nums[i-1];
        return nums;
    }
};